<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
</head>
<body>
<!-- 固定访问的URL不变  -->
    <script>
    // 在页面加载时执行
    window.onload = function() {
        // 将浏览器的URL替换为固定的URL
        window.history.replaceState(null, null, '/admin/');
    };
    </script>
<div class="container">
    <div style="margin-bottom: 10px" class="clearfix">

        <div style="width: 1000px">
            <form method="get">
                <div class="col-lg-6"> <!--                    <div class="input-group">-->
                        筛选条件：
                        <span>IP地址：<input type="text" name="q1" class="form-control" placeholder="请输入IP..." value={{ search_data1 }}>
                        &nbsp&nbsp&nbsp&nbsp

                        <span>地区：</span>
                        <input type="text" name="q2" class="form-control" placeholder="请输入地区..." value={{ search_data2 }}>
                        &nbsp&nbsp&nbsp&nbsp

                        <span>厂商：</span>
                        <input type="text" name="q3" class="form-control" placeholder="请输入厂商..." value={{ search_data3 }}>
                        &nbsp&nbsp<span class="input-group-btn">
                            <button class="btn btn-default"type="submit">搜索
                                <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                            </button>
                        </span>
                </div><!-- /.col-lg-6 -->
            </form>
        </div>
    </div>
    <div class="panel panel-default" >
        <div class="panel-heading">
            <!--span class="glyphicon glyphicon-th-list" aria-hidden="true"></span--> <span>选择要配置的设备:</span>
        </div>
        <form method="POST">
            {% csrf_token %}
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th><input type="checkbox" name="device" value="{{ device.id }}" id="button_all"></th>
                    <th>管理IP</th>
                    <th>设备名称</th>
                    <th>地区</th>
                    <th>厂商</th>
                </tr>
                </thead>
                <tbody> {% for device in devices %}
                <tr>
                    <td><input type="checkbox" name="device" value="{{ device.id }}"></td>
                    <td>{{device.ip}}</td>
                    <td>{{device.dev_name}}</td>
                    <td>{{device.diqu}}</td>
                    <td>{{device.vendor}}</td>
                </tr>
                {% endfor %}
                </tbody>
            </table>
            <h4 class="mt-3">华为设备命令</h4>
                <textarea class="form-control" rows="5" name="huawei_command"></textarea>
                <h4 class="mt-3">思科设备命令</h4>
                <textarea class="form-control" rows="5" name="cisco_command"></textarea> <br>
            <button type="submit" class="mt-3 btn btn-primary">提交命令</button>
        </form>
    </div>
</body>
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
</html>